<?php

namespace IDock\Insurance\ACIC\Request;

use IDock\Insurance\ACIC\Response\VehicleModelResponse;
use IDock\Insurance\ACIC\Request\AllACICRequest;
use IDock\Visitor\VehicleModelVisitor;

class VehicleModelRequest extends AllACICRequest
{
    protected $code = 'Q00';

    protected $response = VehicleModelResponse::class;

    protected $urlTip = '精准车型查询';

    /**
     * @var  VehicleModelVisitor $visitor
     */
    protected $visitor;

    public function generate(): array
    {
        if (!$this->visitor->licenseNo or $this->visitor->licenseNo == '新车') {
            $this->visitor->licenseNo = '*';
        }

        return [
            'LicensePlateNo' => $this->visitor->licenseNo,
            'VIN' => $this->visitor->vin,
            'AreaCode' => $this->visitor->argc['areaCode'],
            'FirstRegisterDate' => $this->visitor->firstRegisterDate
        ];
    }
}
